Skip to content

Upgrade to Rails 8.1#1515

Merged
jazairi merged 13 commits into
mainfrom
rails8
Jul 21, 2026
Merged

Upgrade to Rails 8.1#1515
jazairi merged 13 commits into
mainfrom
rails8

Conversation

@jazairi

@jazairi jazairi commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

This was completed in separate commits to make individual changes easier to parse. Notable changes that affect ETD:

  • Positional enums are now required
  • Pluralization requires more explicit instructions for custom and irregular verbs
  • Devise config loads before the environment file, requiring fallbacks for config variables

In order to avoid further convoluting the PR, I've avoided addressing two issues:

  • Deprecation warnings for ActiveSupport::Multibyte::Chars and String#mb_chars. These should be addressed as part of the Rails 8.2 upgrade.
  • Reintroduction of annotate via the annotaterb gem. Running annotations touched many files. This change will occur in a separate PR.

Developer

  • All new ENV is documented in README
  • All new ENV has been added to Heroku Pipeline, Staging and Prod
  • ANDI or Wave has been run in accordance to
    our guide and
    all issues introduced by these changes have been resolved or opened as new
    issues (link to those issues in the Pull Request details above)
  • Stakeholder approval has been confirmed (or is not needed)

Code Reviewer

  • The commit message is clear and follows our guidelines
    (not just this pull request message)
  • There are appropriate tests covering any new functionality
  • The documentation has been updated or is unnecessary
  • The changes have been verified
  • New dependencies are appropriate or there were no changes

Requires database migrations?

NO

Includes new or updated dependencies?

YES

@accesslint accesslint Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 4 issues across 1 rule.

Comment thread public/400.html
@@ -0,0 +1,135 @@
<!doctype html>

<html lang="en">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best Practice: Page does not contain a level-one heading.

Page should contain a level-one heading.

Details

Page title: "The server cannot process the request due to a client error (400 Bad Request)", Main content: "The server cannot process the request due to a client error. Please check the request and try again."

A level-one heading (<h1> or role='heading' with aria-level='1') helps users understand the page topic and provides a landmark for screen reader navigation. Each page should have at least one level-one heading that describes the main content, typically matching or similar to the page title.

Comment thread public/404.html
</body>
<!doctype html>

<html lang="en">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best Practice: Page does not contain a level-one heading.

Page should contain a level-one heading.

Details

Page title: "The page you were looking for doesn't exist (404 Not found)", Main content: "The page you were looking for doesn't exist. You may have mistyped the address or the page may have "

A level-one heading (<h1> or role='heading' with aria-level='1') helps users understand the page topic and provides a landmark for screen reader navigation. Each page should have at least one level-one heading that describes the main content, typically matching or similar to the page title.

</body>
<!doctype html>

<html lang="en">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best Practice: Page does not contain a level-one heading.

Page should contain a level-one heading.

Details

Page title: "Your browser is not supported (406 Not Acceptable)", Main content: "Your browser is not supported. Please upgrade your browser to continue."

A level-one heading (<h1> or role='heading' with aria-level='1') helps users understand the page topic and provides a landmark for screen reader navigation. Each page should have at least one level-one heading that describes the main content, typically matching or similar to the page title.

Comment thread public/422.html
</body>
<!doctype html>

<html lang="en">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best Practice: Page does not contain a level-one heading.

Page should contain a level-one heading.

Details

Page title: "The change you wanted was rejected (422 Unprocessable Entity)", Main content: "The change you wanted was rejected. Maybe you tried to change something you didn't have access to. I"

A level-one heading (<h1> or role='heading' with aria-level='1') helps users understand the page topic and provides a landmark for screen reader navigation. Each page should have at least one level-one heading that describes the main content, typically matching or similar to the page title.

@mitlib
mitlib temporarily deployed to thesis-submit-pr-1515 July 21, 2026 00:10 Inactive
@coveralls

coveralls commented Jul 21, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 98.25%. remained the same — rails8 into main

@JPrevost JPrevost self-assigned this Jul 21, 2026

@JPrevost JPrevost left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor suggested changes:

Reintroduce:

  • config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
  • production log format stanza

Comment out line for a check we don't need in

  • bin/ci

</title>
<%= render "stylesheet" %>
<%= stylesheet_link_tag "administrate", data: { turbo_track: "reload" } %>
<%= stylesheet_link_tag "administrate/application", data: { turbo_track: "reload" } %>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. So this is how we were able to stop adding this to the precompiled I guess a couple commits back?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, propshaft (the Rails 8 pipeline) uses logical paths instead of precompiled.

# config.require_master_key = true

# Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not still need this? I suppose if the default is to serve we don't. I'm not sure how to test in Heroku that the static files from the public directory are being served in this PR build.

We definitely set RAILS_SERVE_STATIC_FILES so I'm reluctant to remove this unless you are 100% confident the new default is to serve them since we don't run behind nginx/httpd so rails has to serve them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we do, but I agree that it's wise to keep it just in case. I'm also not sure how to confirm in the PR build.

# Do not fall back to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
# Cache assets for far-future expiry since they are all digest stamped.
config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how this wasn't set before. 🤷🏻

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same!

Comment on lines -59 to -62
# Log to STDOUT by default
config.logger = ActiveSupport::Logger.new(STDOUT)
.tap { |logger| logger.formatter = ::Logger::Formatter.new }
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want to keep this logging config and remove the new logger statement on line 38. Without it we lose the log level . We can tune a bit more later as we end up sort of double logging timestamps now that I've looked closer at this but for now let's revert this and work towards standardizing our rails apps logging config in the future.

# application.js, application.css, and all non-JS/CSS in the app/assets
# folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
Rails.application.config.assets.precompile += %w( administrate.css )

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This confused me, but it seems to work so :shipit:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment above about propshaft.

Comment thread config/ci.rb Outdated

step "Style: Ruby", "bin/rubocop"

step "Security: Importmap vulnerability audit", "bin/importmap audit"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we aren't using import maps, we can comment out this line. We probably also aren't immediately adopting running bin/ci but it probably makes sense to comment this out anyone just in case someone runs it. I commented it out in the timdex upgrade so if nothing else this will be consistent :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do. I missed that you'd commented it out in the TIMDEX upgrade.

@jazairi
jazairi temporarily deployed to thesis-submit-pr-1515 July 21, 2026 16:34 Inactive
@jazairi
jazairi requested a review from JPrevost July 21, 2026 16:36
@jazairi
jazairi merged commit 7ad4b48 into main Jul 21, 2026
2 checks passed
@jazairi
jazairi deleted the rails8 branch July 21, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants